x86: allow reading MSR_IA32_TSC with XENPF_resource_op
authorChao Peng <chao.p.peng@linux.intel.com>
Wed, 28 Jan 2015 15:33:01 +0000 (16:33 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 28 Jan 2015 15:36:36 +0000 (16:36 +0100)
commitf6c9698d7f65eca5c1ef5ed325e12252a2fb89fd
treea364d72c1060441575bede321aea8d68e0e47633
parentc2ba001caf5125412bb82325f8a21f3eacf17958
x86: allow reading MSR_IA32_TSC with XENPF_resource_op

Memory bandwidth monitoring requires system time information returned
along with the monitoring counter to verify the correctness of the
counter value and to calculate the time elapsed between two samplings.

Add MSR_IA32_TSC to the read path and it returns scaled system time(ns)
instead of raw timestamp to elimanate the needs to convert. The return
time is obfuscated with booting random to eliminate the potential abuse
of it. RESOURCE_ACCESS_MAX_ENTRIES is also increased to 3 so MSR_IA32_TSC
can be used together with an MSR write/read operation pair.

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
Fix uninitialized variable build error.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/platform_hypercall.c
xen/common/random.c
xen/include/public/platform.h
xen/include/xen/random.h